package poker.com;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Typeface;
import android.os.Bundle;
import android.speech.tts.TextToSpeech;
import android.view.KeyEvent;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.TextView;
import android.widget.Toast;

public class menu extends Activity{

	ImageButton btn;
	TextView tv;
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.main);

		btn = (ImageButton)findViewById(R.id.btnOnly);


		tv=(TextView)findViewById(R.id.barMain);
		Typeface face=Typeface.createFromAsset(getAssets(), "fonts/whatrg.ttf");
		tv.setTypeface(face);
	}


	public void sAccion(View view){
		Intent intent = new Intent();
		intent.setClass(menu.this, poker.class);
		intent.setAction(TextToSpeech.Engine.ACTION_CHECK_TTS_DATA);
		startActivity(intent);


	}

	public boolean onKeyDown(int keyCode, KeyEvent  event) {
		if(keyCode == KeyEvent.KEYCODE_BACK){
			//mensaje();
			finish();
		}
		return true;
	}

	public void mensaje(){

		AlertDialog.Builder alt_bld = new AlertDialog.Builder(this);
		alt_bld.setMessage("Estas seguro de que deseas salir?") // Esto determina la pregunta de la ventana
		.setCancelable(false)
		.setPositiveButton("Aceptar",new DialogInterface.OnClickListener() {
			public void onClick(DialogInterface dialog, int id) {

				// Aqui ponemos el codigo a ejecutar
				// al pulsar el boton gguardar

				finish();
			}
		})
		.setNegativeButton("Cancelar", new DialogInterface.OnClickListener() {
			public void onClick(DialogInterface dialog, int id) {

				// Aqui ponemos el codigo a ejecutar
				// al pulsar el boton �Cancelar�

				Toast.makeText(menu.this, "Operaci�n Cancelada", Toast.LENGTH_SHORT).show();
			}
		});
		AlertDialog alert = alt_bld.create();
		alert.setTitle("Poker Blind"); // Aqui ponemos el titulo de la ventana
		alert.setIcon(R.drawable.icon); // Aqui ponemos el icono de la ventana
		alert.show();

	}
}


